package com.tudouji.project.d3.service.impl;

import java.util.List;
import com.tudouji.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.d3.mapper.LogisticSendfromRuleMapper;
import com.tudouji.project.d3.domain.LogisticSendfromRule;
import com.tudouji.project.d3.service.ILogisticSendfromRuleService;

/**
 * 电商物流发货地址匹配Service业务层处理
 * 
 * @author tudouji
 * @date 2023-12-28
 */
@Service
public class LogisticSendfromRuleServiceImpl implements ILogisticSendfromRuleService 
{
    @Autowired
    private LogisticSendfromRuleMapper logisticSendfromRuleMapper;

    /**
     * 查询电商物流发货地址匹配
     * 
     * @param id 电商物流发货地址匹配ID
     * @return 电商物流发货地址匹配
     */
    @Override
    public LogisticSendfromRule selectLogisticSendfromRuleById(Long id)
    {
        return logisticSendfromRuleMapper.selectLogisticSendfromRuleById(id);
    }

    /**
     * 查询电商物流发货地址匹配列表
     * 
     * @param logisticSendfromRule 电商物流发货地址匹配
     * @return 电商物流发货地址匹配
     */
    @Override
    public List<LogisticSendfromRule> selectLogisticSendfromRuleList(LogisticSendfromRule logisticSendfromRule)
    {
        return logisticSendfromRuleMapper.selectLogisticSendfromRuleList(logisticSendfromRule);
    }

    /**
     * 新增电商物流发货地址匹配
     * 
     * @param logisticSendfromRule 电商物流发货地址匹配
     * @return 结果
     */
    @Override
    public int insertLogisticSendfromRule(LogisticSendfromRule logisticSendfromRule)
    {
        logisticSendfromRule.setCreateTime(DateUtils.getNowDate());
        return logisticSendfromRuleMapper.insertLogisticSendfromRule(logisticSendfromRule);
    }

    /**
     * 修改电商物流发货地址匹配
     * 
     * @param logisticSendfromRule 电商物流发货地址匹配
     * @return 结果
     */
    @Override
    public int updateLogisticSendfromRule(LogisticSendfromRule logisticSendfromRule)
    {
        logisticSendfromRule.setUpdateTime(DateUtils.getNowDate());
        return logisticSendfromRuleMapper.updateLogisticSendfromRule(logisticSendfromRule);
    }

    /**
     * 批量删除电商物流发货地址匹配
     * 
     * @param ids 需要删除的电商物流发货地址匹配ID
     * @return 结果
     */
    @Override
    public int deleteLogisticSendfromRuleByIds(Long[] ids)
    {
        return logisticSendfromRuleMapper.deleteLogisticSendfromRuleByIds(ids);
    }

    /**
     * 删除电商物流发货地址匹配信息
     * 
     * @param id 电商物流发货地址匹配ID
     * @return 结果
     */
    @Override
    public int deleteLogisticSendfromRuleById(Long id)
    {
        return logisticSendfromRuleMapper.deleteLogisticSendfromRuleById(id);
    }
}
